#pragma once

#include <string>
#include <fstream>
using namespace std;

#include "topcvt_cfg.hpp"

namespace topcvt
{
	class PktResourceLoader
	{
		static string m_pathDir;
		static bool m_pathOption;
		static map<string, string> m_resource;
		static map<string, long> m_lastTime;

		static bool cacheContains(const string& fileName);
		static void put2Cache(const string& fileName, const long lastModified, const string& context);
	public:
		static void setPathLoadOption(bool option,const string& pathDir=string());
		static string getPathDir();
		static uint64_t getPktMtime(const char* lpszFileName);
		static RootCfg& getPktCfg(const string& pktPath,RootCfg&);
		static RootCfg& getPktBuf(const string& pktBuff,RootCfg&);
    };
};